The game

Now I turn your attention to the game data. On groups of 4 we played with the 256 fishermen a fishing game, where each person were supposed to make a decision on how much to fish. Each group of 4 fishermen shared a common fish stock that started with 50 fish. Their decisions were private but they could communicate throghout the game. The game lasted 16 rounds unless they collapsed their resource, of which 6 rounds where for learning the game (‘base line within treatments’) and another 10 rounds they had to face one of four possible situations or treatments. Base line groups continued playing the same game as the first 6 rounds. Threshold treatment players were informed that a climate event has occurred decreasing the reproduction rate of the resource. Risk treatment players faced a similar situation but the event was not certain, they knew that the probability of the event happening was of 50% chance. Uncertainty treatment also faced the possibility of a climate event on the second part of the game but players didn’t know the actual probability of the event. The figure below shows a summary of all time lines of the game per place and per treatment. The blue line shows the mean of the time series while the shaded area shows the smooth, this is the Gaussian confidence intervals based on the t-distribution (so we assume normality). The red line marks round 6, this is the end of the first part of the game. It helps to caution the reader that in round 7 the treatment started and we reset the fish stock size to 50 as in the beginning of the game, that’s why in all timelines there is a ‘jump’ from round 6 to 7.

dat <- read.csv(file="~/Dropbox/BEST/Colombia/0_Game data/160427_corrected_full_data_long.csv", row.names=1)

g <- ggplot(dat=dat, aes(x=Round, y=value)) + 
        geom_vline( aes( xintercept=6, color='red', alpha=0.1), show.legend = F) + 
        stat_summary(fun.data='mean_cl_normal', geom='smooth') + # option 'mean_cl_boot I like the most but normal assumes normality
        facet_grid(Treatment ~ Place) 
g

Now imagine each individual is exploring the parameter space of the stock size at the beginning of each round (which depends on what the group did on the previous round), and her/his own decision. Each individual will then follow a trajectory on that phase diagram that potentially capture a signature of her/his strategy. The figure below shows such trajectory, where each line represents the time series of each person for the afternoon session in Las Flores on February 4th. We played simultaneously with 16 players, 4 in each of the 4 above mentioned treatments. Here we see that the base line group collapsed twice, once on round 5 and another in round 11; this is why we see the line broken and never reaching the light blue colour that denotes the end of the game. Here it also comes clear that, for example, people who played the threshold treatment collectively chose to stay on high levels of the resource by fishing maximum 4 units and maintaining their resource above 38 fishes.

datP1 <- dat %>%
  filter(dat$Place == 'Las Flores' & dat$Session == 'pm' & Date == "2016-02-04" ) %>%
  gdata::drop.levels()

p <- ggplot(data=datP1, aes(x=value, y=StockSizeBegining), group=Player) + 
        geom_path(aes(color=Round)) + facet_grid(Treatment~Player) +
        ggtitle('Phase space trajectory per player\n Las Flores, 2016-02-04-pm ') + 
        theme(text= element_text(family='Helvetica', size=9))

p

At the group level, the same rationale can be applied if one plots the stock size at the begining of each round against the sum of the total catch for all 4 participants per group. Note that we have in total 64 groups (4 treatments * 4 sessions * 4 locations). The figure below summarizes all 64 groups, each one represented with a colour, and each colour showing the contour or the parameter space where most points were concentrated by location and treatment. The contour was calculated with a 2-dimensional smoother (bandwidth = 15). The figure on the left shows the aggregated group behaviour by ploting the sum of the total catch. The figure on the right shows the resource dynamics at the beginning of each round vs. the resource at the end of the round which is the same as the new stock size for the next round, this is what people fish plus the reproduction in the round. In dynamical systems this is equivalent to \(f(x[t+1]):x[t]\).

c <- ggplot(data=dat, aes(y=StockSizeBegining, x=SumTotalCatch), group=Session) + 
  stat_density_2d(aes(color=group, alpha=0.5), n=100, h=15, show.legend = F) + 
  facet_grid( Treatment ~ Place)+ 
    theme(text= element_text(family='Helvetica', size=9))
p <- ggplot(data=dat, aes(y=NewStockSize, x=StockSizeBegining), group=Session) + 
  geom_abline(aes(color='black', alpha=0.5),slope=1, intercept = 0) +
  stat_density_2d(aes(color=group, alpha=0.3), n=100, h=15, show.legend = F) + 
  geom_point(aes(color=group, alpha=0.3), show.legend=F) + 
  facet_grid( Treatment ~ Place)+ 
    theme(text= element_text(family='Helvetica', size=9))

grid.arrange ( c,p, ncol=2, nrow=1 )

The next natural question to ask is whether there is an effect between:

  • The first and the second part of the game
  • Treatments
  • Place

The four panels below try to get to these differences

pm1 <- ggpairs(data= filter(dat, dat$part == F), 
              columns=c('StockSizeBegining', 'NewStockSize', 'Treatment','Place'), 
              upper= list(continuous='density'), lower=list(continuous='points'), 
              mapping=aes(color= Place, alpha=0.5), title='Color by place, first part') 

pm2 <- ggpairs(data= filter(dat, dat$part == T), 
              columns=c('StockSizeBegining', 'NewStockSize', 'Treatment','Place'), 
              upper= list(continuous='density'), lower=list(continuous='points'), 
              mapping=aes(color= Place, alpha=0.5), title='Color by place, second part') 

pm3 <- ggpairs(data= filter(dat, dat$part == F), 
              columns=c('StockSizeBegining', 'NewStockSize', 'Treatment','Place'), 
              upper= list(continuous='density'), lower=list(continuous='points'), 
              mapping=aes(color= Treatment, alpha=0.5), title='Color by treatment, second part') 

pm4 <- ggpairs(data= filter(dat, dat$part == T), 
              columns=c('StockSizeBegining', 'NewStockSize', 'Treatment','Place'), 
              upper= list(continuous='density'), lower=list(continuous='points'), 
              mapping=aes(color= Treatment, alpha=0.5), title='Color by treatment, second part') 

#grid.arrange(
  pm1   + theme(text= element_text(family='Helvetica', size=6))
  pm2   + theme(text= element_text(family='Helvetica', size=6))
  pm3   + theme(text= element_text(family='Helvetica', size=6))
  pm4   + theme(text= element_text(family='Helvetica', size=6))
#  ncol=2, nrow=2
#)

Fishing styles

Something I’d really like to get into (for modeling purposes) is identifying fishing strategies or styles. To do so I ran a PCA and MDS on the time series (16 rounds) of each of the 256 players in our dataset. The results are shown below.

library(vegan)
players <- (reshape::cast(dat, ID_player ~ Round))[,-1] #delete playersID
place <- reshape::cast(dat, ID_player ~  Place)[,-1] # 16 because calculate length of 'value'
group <- reshape::cast(dat, ID_player ~  group)[,-1]
treat <- reshape::cast(dat, ID_player ~  Treatment)[,-1]
context <- cbind(place,treat) # don't use group yet, maybe for aes

pca <- rda(players, context) #, context

# note: I ran mds with 'euclidean' distance and 'manhattan'. Euclidean gave an error saying there is not enough data. manhattan calculated but didn't reach convergence. Morisita, jaccard, kulczynski, horn, rau, don't reach convergence neither. Frequent error on different measures: Stress is (nearly) zero - you may have insufficient data. It does work however if I use the transpose. It calculates the ordering of rounds on mds$points, but the ordering of players can be found too at mds$species
mds <- metaMDS(players, dist= 'manhattan', trymax=400, autotransform=F, k=2)
## Run 0 stress 0.1683166 
## Run 1 stress 0.1702613 
## Run 2 stress 0.1708013 
## Run 3 stress 0.169251 
## Run 4 stress 0.1716763 
## Run 5 stress 0.1727906 
## Run 6 stress 0.1722301 
## Run 7 stress 0.1713323 
## Run 8 stress 0.1693672 
## Run 9 stress 0.1744119 
## Run 10 stress 0.1753553 
## Run 11 stress 0.1752705 
## Run 12 stress 0.1726155 
## Run 13 stress 0.1695868 
## Run 14 stress 0.1701221 
## Run 15 stress 0.1729992 
## Run 16 stress 0.1697914 
## Run 17 stress 0.1715771 
## Run 18 stress 0.1734178 
## Run 19 stress 0.1698375 
## Run 20 stress 0.1701696 
## Run 21 stress 0.1737909 
## Run 22 stress 0.1699831 
## Run 23 stress 0.1720101 
## Run 24 stress 0.173051 
## Run 25 stress 0.1728509 
## Run 26 stress 0.1699474 
## Run 27 stress 0.1711008 
## Run 28 stress 0.1763573 
## Run 29 stress 0.1720386 
## Run 30 stress 0.1776426 
## Run 31 stress 0.1718475 
## Run 32 stress 0.1759847 
## Run 33 stress 0.1718547 
## Run 34 stress 0.1696526 
## Run 35 stress 0.1702353 
## Run 36 stress 0.1686282 
## ... procrustes: rmse 0.00579523  max resid 0.06538604 
## Run 37 stress 0.1723363 
## Run 38 stress 0.1719062 
## Run 39 stress 0.1733908 
## Run 40 stress 0.1717625 
## Run 41 stress 0.1714101 
## Run 42 stress 0.1692279 
## Run 43 stress 0.1716113 
## Run 44 stress 0.171448 
## Run 45 stress 0.1729893 
## Run 46 stress 0.1716371 
## Run 47 stress 0.1708159 
## Run 48 stress 0.1714363 
## Run 49 stress 0.1712416 
## Run 50 stress 0.1714648 
## Run 51 stress 0.1734842 
## Run 52 stress 0.1758839 
## Run 53 stress 0.1705926 
## Run 54 stress 0.1751697 
## Run 55 stress 0.1734461 
## Run 56 stress 0.173778 
## Run 57 stress 0.1761284 
## Run 58 stress 0.1757704 
## Run 59 stress 0.1696433 
## Run 60 stress 0.1683994 
## ... procrustes: rmse 0.008867218  max resid 0.1013378 
## Run 61 stress 0.1710631 
## Run 62 stress 0.1715068 
## Run 63 stress 0.1726098 
## Run 64 stress 0.1735487 
## Run 65 stress 0.1757703 
## Run 66 stress 0.1732433 
## Run 67 stress 0.1705379 
## Run 68 stress 0.1761931 
## Run 69 stress 0.1748258 
## Run 70 stress 0.1710778 
## Run 71 stress 0.1750057 
## Run 72 stress 0.1703645 
## Run 73 stress 0.1686477 
## ... procrustes: rmse 0.005746816  max resid 0.06480613 
## Run 74 stress 0.1724448 
## Run 75 stress 0.1705945 
## Run 76 stress 0.1705088 
## Run 77 stress 0.1754567 
## Run 78 stress 0.1712269 
## Run 79 stress 0.1716015 
## Run 80 stress 0.175452 
## Run 81 stress 0.1700298 
## Run 82 stress 0.1727201 
## Run 83 stress 0.1766317 
## Run 84 stress 0.1732009 
## Run 85 stress 0.170499 
## Run 86 stress 0.1693457 
## Run 87 stress 0.1729457 
## Run 88 stress 0.1698541 
## Run 89 stress 0.1696066 
## Run 90 stress 0.1737843 
## Run 91 stress 0.1758707 
## Run 92 stress 0.1786852 
## Run 93 stress 0.1706546 
## Run 94 stress 0.1705825 
## Run 95 stress 0.1719986 
## Run 96 stress 0.1706617 
## Run 97 stress 0.1730782 
## Run 98 stress 0.1725339 
## Run 99 stress 0.1713156 
## Run 100 stress 0.1725887 
## Run 101 stress 0.169251 
## Run 102 stress 0.1707888 
## Run 103 stress 0.1758935 
## Run 104 stress 0.1698306 
## Run 105 stress 0.1774174 
## Run 106 stress 0.1746126 
## Run 107 stress 0.1704909 
## Run 108 stress 0.1721952 
## Run 109 stress 0.1698502 
## Run 110 stress 0.1717822 
## Run 111 stress 0.1730565 
## Run 112 stress 0.1716377 
## Run 113 stress 0.1689432 
## Run 114 stress 0.1683187 
## ... procrustes: rmse 0.001836863  max resid 0.0211627 
## Run 115 stress 0.1701225 
## Run 116 stress 0.1727834 
## Run 117 stress 0.1697415 
## Run 118 stress 0.1723571 
## Run 119 stress 0.1720459 
## Run 120 stress 0.1712297 
## Run 121 stress 0.1716834 
## Run 122 stress 0.1715722 
## Run 123 stress 0.1687833 
## ... procrustes: rmse 0.006550399  max resid 0.07906555 
## Run 124 stress 0.1710484 
## Run 125 stress 0.1746082 
## Run 126 stress 0.1699652 
## Run 127 stress 0.1698338 
## Run 128 stress 0.17369 
## Run 129 stress 0.1701421 
## Run 130 stress 0.1707356 
## Run 131 stress 0.1712664 
## Run 132 stress 0.1696905 
## Run 133 stress 0.1708566 
## Run 134 stress 0.1697479 
## Run 135 stress 0.1763707 
## Run 136 stress 0.1713229 
## Run 137 stress 0.1683985 
## ... procrustes: rmse 0.009063853  max resid 0.1016625 
## Run 138 stress 0.1735266 
## Run 139 stress 0.1743185 
## Run 140 stress 0.1722351 
## Run 141 stress 0.1756335 
## Run 142 stress 0.1740119 
## Run 143 stress 0.1724724 
## Run 144 stress 0.1707321 
## Run 145 stress 0.1717299 
## Run 146 stress 0.1734817 
## Run 147 stress 0.174365 
## Run 148 stress 0.1725239 
## Run 149 stress 0.1731255 
## Run 150 stress 0.1717817 
## Run 151 stress 0.1701702 
## Run 152 stress 0.1729142 
## Run 153 stress 0.1705985 
## Run 154 stress 0.1723335 
## Run 155 stress 0.169731 
## Run 156 stress 0.1780565 
## Run 157 stress 0.1730554 
## Run 158 stress 0.1699006 
## Run 159 stress 0.1700948 
## Run 160 stress 0.1708597 
## Run 161 stress 0.1714275 
## Run 162 stress 0.1746839 
## Run 163 stress 0.1721427 
## Run 164 stress 0.169308 
## Run 165 stress 0.1697828 
## Run 166 stress 0.1724018 
## Run 167 stress 0.1750936 
## Run 168 stress 0.1713138 
## Run 169 stress 0.1706342 
## Run 170 stress 0.1793896 
## Run 171 stress 0.1743106 
## Run 172 stress 0.171105 
## Run 173 stress 0.1706833 
## Run 174 stress 0.1690062 
## Run 175 stress 0.1718815 
## Run 176 stress 0.171159 
## Run 177 stress 0.1737048 
## Run 178 stress 0.1705573 
## Run 179 stress 0.1715799 
## Run 180 stress 0.175229 
## Run 181 stress 0.1713098 
## Run 182 stress 0.174291 
## Run 183 stress 0.1728163 
## Run 184 stress 0.1696701 
## Run 185 stress 0.1776693 
## Run 186 stress 0.1720768 
## Run 187 stress 0.1738713 
## Run 188 stress 0.1693238 
## Run 189 stress 0.1725456 
## Run 190 stress 0.1706512 
## Run 191 stress 0.1699134 
## Run 192 stress 0.1706496 
## Run 193 stress 0.169856 
## Run 194 stress 0.1697748 
## Run 195 stress 0.1696202 
## Run 196 stress 0.1709711 
## Run 197 stress 0.1699838 
## Run 198 stress 0.1715888 
## Run 199 stress 0.1769722 
## Run 200 stress 0.1693386 
## Run 201 stress 0.1735185 
## Run 202 stress 0.1728653 
## Run 203 stress 0.1696862 
## Run 204 stress 0.172482 
## Run 205 stress 0.1699562 
## Run 206 stress 0.1702945 
## Run 207 stress 0.171307 
## Run 208 stress 0.1697574 
## Run 209 stress 0.1751721 
## Run 210 stress 0.1731313 
## Run 211 stress 0.1723551 
## Run 212 stress 0.1719151 
## Run 213 stress 0.1749485 
## Run 214 stress 0.1709162 
## Run 215 stress 0.1747079 
## Run 216 stress 0.1726827 
## Run 217 stress 0.1699576 
## Run 218 stress 0.1697668 
## Run 219 stress 0.1705724 
## Run 220 stress 0.1757768 
## Run 221 stress 0.1714191 
## Run 222 stress 0.1715799 
## Run 223 stress 0.1696412 
## Run 224 stress 0.1732335 
## Run 225 stress 0.1693673 
## Run 226 stress 0.1737502 
## Run 227 stress 0.1703496 
## Run 228 stress 0.1720525 
## Run 229 stress 0.1721953 
## Run 230 stress 0.1749897 
## Run 231 stress 0.1695472 
## Run 232 stress 0.1705683 
## Run 233 stress 0.1702982 
## Run 234 stress 0.1711383 
## Run 235 stress 0.1712658 
## Run 236 stress 0.1756456 
## Run 237 stress 0.1754389 
## Run 238 stress 0.1763367 
## Run 239 stress 0.1683626 
## ... procrustes: rmse 0.006691132  max resid 0.1006848 
## Run 240 stress 0.1696296 
## Run 241 stress 0.1711507 
## Run 242 stress 0.1709426 
## Run 243 stress 0.1716361 
## Run 244 stress 0.1708603 
## Run 245 stress 0.1718648 
## Run 246 stress 0.1742714 
## Run 247 stress 0.1705121 
## Run 248 stress 0.1755827 
## Run 249 stress 0.1746763 
## Run 250 stress 0.1750173 
## Run 251 stress 0.1702044 
## Run 252 stress 0.175471 
## Run 253 stress 0.1745952 
## Run 254 stress 0.1763617 
## Run 255 stress 0.1695822 
## Run 256 stress 0.1709422 
## Run 257 stress 0.1738556 
## Run 258 stress 0.1852298 
## Run 259 stress 0.1701195 
## Run 260 stress 0.1693911 
## Run 261 stress 0.1729093 
## Run 262 stress 0.1741399 
## Run 263 stress 0.1700438 
## Run 264 stress 0.1734749 
## Run 265 stress 0.1708869 
## Run 266 stress 0.1699286 
## Run 267 stress 0.1700991 
## Run 268 stress 0.1720846 
## Run 269 stress 0.1722556 
## Run 270 stress 0.1711703 
## Run 271 stress 0.175026 
## Run 272 stress 0.1704948 
## Run 273 stress 0.1702824 
## Run 274 stress 0.1701185 
## Run 275 stress 0.1752996 
## Run 276 stress 0.171528 
## Run 277 stress 0.1744742 
## Run 278 stress 0.1717954 
## Run 279 stress 0.1703586 
## Run 280 stress 0.1701244 
## Run 281 stress 0.171759 
## Run 282 stress 0.1742381 
## Run 283 stress 0.1696649 
## Run 284 stress 0.173692 
## Run 285 stress 0.1717834 
## Run 286 stress 0.1691635 
## Run 287 stress 0.177043 
## Run 288 stress 0.1696333 
## Run 289 stress 0.1734024 
## Run 290 stress 0.1741368 
## Run 291 stress 0.168819 
## Run 292 stress 0.1718541 
## Run 293 stress 0.1709181 
## Run 294 stress 0.1712302 
## Run 295 stress 0.1715623 
## Run 296 stress 0.1745577 
## Run 297 stress 0.1739656 
## Run 298 stress 0.1761521 
## Run 299 stress 0.1712941 
## Run 300 stress 0.1697229 
## Run 301 stress 0.1707848 
## Run 302 stress 0.1704692 
## Run 303 stress 0.1699057 
## Run 304 stress 0.170753 
## Run 305 stress 0.1712148 
## Run 306 stress 0.1723656 
## Run 307 stress 0.1729206 
## Run 308 stress 0.1724516 
## Run 309 stress 0.1696549 
## Run 310 stress 0.171325 
## Run 311 stress 0.1686662 
## ... procrustes: rmse 0.004206352  max resid 0.0640644 
## Run 312 stress 0.1710222 
## Run 313 stress 0.1721196 
## Run 314 stress 0.1718835 
## Run 315 stress 0.1738332 
## Run 316 stress 0.176234 
## Run 317 stress 0.1707007 
## Run 318 stress 0.1710328 
## Run 319 stress 0.1773859 
## Run 320 stress 0.1694716 
## Run 321 stress 0.1723402 
## Run 322 stress 0.1730909 
## Run 323 stress 0.1696258 
## Run 324 stress 0.1716153 
## Run 325 stress 0.171836 
## Run 326 stress 0.1773795 
## Run 327 stress 0.168731 
## ... procrustes: rmse 0.009387307  max resid 0.1023246 
## Run 328 stress 0.1692345 
## Run 329 stress 0.1721967 
## Run 330 stress 0.1723217 
## Run 331 stress 0.1694151 
## Run 332 stress 0.1701215 
## Run 333 stress 0.1701037 
## Run 334 stress 0.1730525 
## Run 335 stress 0.1706493 
## Run 336 stress 0.1719364 
## Run 337 stress 0.1709856 
## Run 338 stress 0.1705277 
## Run 339 stress 0.1731446 
## Run 340 stress 0.1702516 
## Run 341 stress 0.1704777 
## Run 342 stress 0.1698034 
## Run 343 stress 0.1701052 
## Run 344 stress 0.1687729 
## ... procrustes: rmse 0.006663923  max resid 0.07925868 
## Run 345 stress 0.1724862 
## Run 346 stress 0.1722735 
## Run 347 stress 0.1733484 
## Run 348 stress 0.1743764 
## Run 349 stress 0.1770041 
## Run 350 stress 0.1767661 
## Run 351 stress 0.1685455 
## ... procrustes: rmse 0.008449541  max resid 0.101199 
## Run 352 stress 0.1713517 
## Run 353 stress 0.1700021 
## Run 354 stress 0.170826 
## Run 355 stress 0.1713447 
## Run 356 stress 0.1748598 
## Run 357 stress 0.16977 
## Run 358 stress 0.1706025 
## Run 359 stress 0.1730151 
## Run 360 stress 0.1721128 
## Run 361 stress 0.1697074 
## Run 362 stress 0.1727815 
## Run 363 stress 0.1725743 
## Run 364 stress 0.1706975 
## Run 365 stress 0.1727864 
## Run 366 stress 0.1713875 
## Run 367 stress 0.1698577 
## Run 368 stress 0.1727365 
## Run 369 stress 0.1744908 
## Run 370 stress 0.168911 
## Run 371 stress 0.1749218 
## Run 372 stress 0.176263 
## Run 373 stress 0.170977 
## Run 374 stress 0.1732407 
## Run 375 stress 0.1786487 
## Run 376 stress 0.16984 
## Run 377 stress 0.1731463 
## Run 378 stress 0.1701998 
## Run 379 stress 0.1737353 
## Run 380 stress 0.1692163 
## Run 381 stress 0.1684479 
## ... procrustes: rmse 0.006224877  max resid 0.06695016 
## Run 382 stress 0.1735448 
## Run 383 stress 0.1724648 
## Run 384 stress 0.1732001 
## Run 385 stress 0.170306 
## Run 386 stress 0.1698554 
## Run 387 stress 0.1729626 
## Run 388 stress 0.1709845 
## Run 389 stress 0.1709871 
## Run 390 stress 0.1720952 
## Run 391 stress 0.1704974 
## Run 392 stress 0.170129 
## Run 393 stress 0.1712321 
## Run 394 stress 0.1729331 
## Run 395 stress 0.1696437 
## Run 396 stress 0.1729086 
## Run 397 stress 0.1699687 
## Run 398 stress 0.1709042 
## Run 399 stress 0.1684543 
## ... procrustes: rmse 0.006587365  max resid 0.07794172 
## Run 400 stress 0.1760206
# mds2 <- metaMDS(players, dist= 'mahalanobis', trymax=1000, autotransform=F, k=3, previous.best = mds) # solution from http://stackoverflow.com/questions/14434794/no-stable-solution-using-metamds-in-vegan
ef1 <- envfit(mds, context, permu=999)

par(mfrow=c(1,3))
  plot(pca)
  plot(mds, type='p', display=c('sites', 'species'), cex=0.8)
  plot(ef1, p.max=0.05, col='blue', cex=0.8)
  stressplot(mds)
    

PCA always gives some results (but meaningful?) and MDS very often runs into problems of non-convergence. PCA and MDS assumes that observations are independent. Here, they aren’t because what a player does influence what other players do, so they are not independent among group members, but they are between groups. In addition, since in the game what happens in the future depends of what people played in the past, there is not independence between rounds neither. After a long talk with Ingo, a possible solution is running the ordination method at the group level, after de-trending the data with e.g. demean it.


dat <- mutate(dat, val.dtrend = value - mean(value))
players <- mutate(players, avg.log = apply(players, 1, function (x) {log10(mean(x))} ),
                  sd.log = apply (players, 1, function (x) {log10(sd(x))}) 
                  )
p1 <- ggplot(players, aes(x=avg.log, y=sd.log)) + 
  geom_abline(intercept=0, slope=0.55) + 
  geom_point() #+ scale_x_log10() + scale_y_log10()
p1
# The lines below should produce the same plot but is not working
# p1 <- ggplot(dat, aes(x=mean(value), y=sd(value), group = levels(ID_player))) + 
#  # geom_abline(intercept=0, slope=0.55) + 
#   geom_point( show.legend = F) #+ scale_x_log10() + scale_y_log10()

To-Do

  1. ggpairs plots for treatments, place, and before/after
  2. statistics: t-test, Mann-Witness test, Fisher exact test for all
  3. some simple regressions
  4. styles clustering
g <- ggplot(dat, aes(x=value, y=StockSizeBegining,color=Treatment )) +
        geom_point() +
        geom_smooth( method='loess') +
        ggtitle('Local polynomial regression\n Stock size vs Decision')
g